/*
 *  Copyright 2008-2010 www.jrails.org
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package org.rails.extjs.chart;

import org.rails.extjs.AbsBase;
import org.rails.extjs.javascript.JavaScript;

public abstract class Axis extends AbsBase {

	public Axis() {
		super();
	}
	
	public Axis(String title) {
		super();
		setTitle(title);
	}
	
	public void setStackingEnabled(Boolean stackingEnabled){
		addOption("stackingEnabled",stackingEnabled);
	}
	
	public Boolean isStackingEnabled(){
		return getBoolean("stackingEnabled",false);
	}
	
	public void setTitle(String title){
		addOption("title",title);
	}
	
	public String getTitle(){
		return getString("title","");
	}

	public void setHideOverlappingLabels(Boolean hideOverlappingLabels){
		addOption("hideOverlappingLabels", hideOverlappingLabels);
	}
	
	public Boolean isHideOverlappingLabels(){
		return getBoolean("hideOverlappingLabels", false);
	}
	
	public void setLabelFunction(String labelFunction){
		addOption("labelFunction", labelFunction);
	}
	public String getLabelFunction(){
		return getString("labelFunction", "");
	}
	
	public void setLabelSpacing(Integer labelSpacing){
		addOption("labelSpacing", labelSpacing);
	}
	
	public Integer getLabelSpacing(){
		return getInteger("labelSpacing",0);
	}
	
	public void setOrientation(String orientation){
		addOption("orientation", orientation);
	}
	public String getOrientation(){
		return getString("orientation","horizontal"); 
	}
	
	public void setReverse(Boolean reverse){
		addOption("reverse", reverse);
	}
	
	public Boolean isReverse(){
		return getBoolean("reverse",true);
	}
	
	 public void setType(String type){
		 addOption("type", type);
	 }
	 public String getType(){
		 return getString("type", "");
	 }
	 
	 public void setLabelRenderer(JavaScript labelRenderer){
		 addOption("labelRenderer",labelRenderer);
	 }
	 
	 public JavaScript getLabelRenderer(){
		return (JavaScript) getOption("labelRenderer");
	 }

}
